package com.wn26.shopczpro.utils;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;


public class DataSourceUtils {

	private static final ComboPooledDataSource ds = new ComboPooledDataSource("mysql");

	public static DataSource getDataSource() {

		return ds;
	}

	/**
	 * 针对事务获取连接的!
	 * 
	 * @return
	 * @throws SQLException
	 */
	public static Connection getConnection() throws SQLException {

		return ds.getConnection();
	}

}
